package com.wujie.liu.section17;

/**
 * Created by wujieliu on 2018/1/31.
 */
public class User implements Comparable<User> {
    private Integer age;
    private String name;

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public int compareTo(User o) {
        if (this.age > o.getAge()) {
            return 1;
        } else {
            return 0;
        }
    }
}
